package com.yonyou.isv.demo.openapi.api.message;

import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataStringResponse;
import com.yonyou.isv.demo.openapi.api.BaseOpenApi;
import com.yonyou.isv.demo.openapi.api.OpenApiURL;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 工作通知
 */
@Component
public class NotifyShareApi extends BaseOpenApi {

    /**
     * 依据业务id将工作通知标为已读
     * @param params
     * @return
     */
    public String read(Map<String, Object> params) {
        ApiDataStringResponse apiDataResponse =  postForEntity(OpenApiURL.NOTIFY_READ,params, ApiDataStringResponse.class);
        return getData(apiDataResponse);
    }

    /**
     * 发送工作通知
     * @param params
     * @return
     */
    public String notifyShare(Map<String, Object> params) {
        ApiDataStringResponse apiDataResponse =  postForEntity(OpenApiURL.NOTIFY_SHARE,params, ApiDataStringResponse.class);
        return getData(apiDataResponse);
    }

}
